using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VMCHAR
    {
        public DataRow Convert2MCHAR(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryMCHAR(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["MCMANDANT"] = " ".PadRight(2 ); 
         dwReturn["MCCHAR"] = " ".PadRight(0 ); 
         dwReturn["MCMAT"] = " ".PadRight(14 ); 
         dwReturn["MCVAR"] = " ".PadRight(3 ); 
         dwReturn["MCEINDAT"] = " ".PadRight(0 ); 
         dwReturn["MCENTKZ"] = " ".PadRight(1 ); 
         dwReturn["MCEINLO"] = " ".PadRight(2 ); 
         dwReturn["MCSPSTA"] = " ".PadRight(2 ); 
         dwReturn["MCSPGRD"] = " ".PadRight(2 ); 
         dwReturn["MCME"] = " ".PadRight(0 ); 
         dwReturn["MCEMEN"] = " ".PadRight(0 ); 
         dwReturn["MCEGEB"] = " ".PadRight(1 ); 
         dwReturn["MCGNRL"] = " ".PadRight(0 ); 
         dwReturn["MCLIEFNR"] = " ".PadRight(8 ); 
         dwReturn["MCLIEFSCH"] = " ".PadRight(10 ); 
         dwReturn["MCLIEFDAT"] = " ".PadRight(0 ); 
         dwReturn["MCKZZOLL"] = " ".PadRight(1 ); 
         dwReturn["MCGEBANZ"] = " ".PadRight(0 ); 
         dwReturn["MCVPEINH"] = " ".PadRight(4 ); 
         dwReturn["MCLMEH"] = " ".PadRight(3 ); 
         dwReturn["MCLMEN"] = " ".PadRight(0 ); 
         dwReturn["MCLMEB"] = " ".PadRight(0 ); 
         dwReturn["MCAUFTYP"] = " ".PadRight(1 ); 
         dwReturn["MCBESTKRS"] = " ".PadRight(2 ); 
         dwReturn["MCBESTLFD"] = " ".PadRight(0 ); 
         dwReturn["MCBESTPOS"] = " ".PadRight(0 ); 
         dwReturn["MCABHS"] = " ".PadRight(0 ); 
         dwReturn["MCBUDGET"] = " ".PadRight(8 ); 
         dwReturn["MCRENR"] = " ".PadRight(10 ); 
         dwReturn["MCREDAT"] = " ".PadRight(0 ); 
         dwReturn["MCREWERT"] = " ".PadRight(0 ); 
         dwReturn["MCHALTT"] = " ".PadRight(0 ); 
         dwReturn["MCHERDAT"] = " ".PadRight(0 ); 
         dwReturn["MCVERFDAT"] = " ".PadRight(0 ); 
         dwReturn["MCAENDZL"] = " ".PadRight(0 ); 
         dwReturn["MCAENDBEN"] = " ".PadRight(8 ); 
         dwReturn["MCAENDDAT"] = " ".PadRight(0 ); 
         dwReturn["MCNEUBEN"] = " ".PadRight(8 ); 
         dwReturn["MCNEUDAT"] = " ".PadRight(0 ); 
         dwReturn["MCKZKONSI"] = " ".PadRight(1 ); 
         dwReturn["MCTEILLFG"] = " ".PadRight(1 ); 
         dwReturn["MCMAENGEL"] = " ".PadRight(1 ); 
         dwReturn["MCZUDIRVB"] = " ".PadRight(1 ); 
         dwReturn["MCEINLB"] = " ".PadRight(2 ); 
         dwReturn["MCSPEDF"] = " ".PadRight(1 ); 
         dwReturn["MCSPEDV"] = " ".PadRight(1 ); 
         dwReturn["MCSPEDZ"] = " ".PadRight(1 ); 
         dwReturn["MCURRENR"] = " ".PadRight(10 ); 
         dwReturn["MCARTGS"] = " ".PadRight(2 ); 
         dwReturn["MCVERF"] = " ".PadRight(5 ); 
         dwReturn["MCAVVME"] = " ".PadRight(1 ); 
         dwReturn["MCBEWPFL"] = " ".PadRight(1 ); 
         dwReturn["MCBEFREI"] = " ".PadRight(4 ); 
         dwReturn["MCURLAND"] = " ".PadRight(3 ); 
         dwReturn["MCIURLAND"] = " ".PadRight(2 ); 
         dwReturn["MCHALAND"] = " ".PadRight(3 ); 
         dwReturn["MCVSLAND"] = " ".PadRight(3 ); 
         dwReturn["MCVZWEIG"] = " ".PadRight(1 ); 
         dwReturn["MCTPMLKZ"] = " ".PadRight(3 ); 
         dwReturn["MCCONTV"] = " ".PadRight(1 ); 
         dwReturn["MCCONTNR"] = " ".PadRight(20 ); 
         dwReturn["MCZOLLST"] = " ".PadRight(6 ); 
         dwReturn["MCZOLLSTAF"] = " ".PadRight(6 ); 
         dwReturn["MCPRLAND"] = " ".PadRight(3 ); 
         dwReturn["MCURLANDWO"] = " ".PadRight(3 ); 
         dwReturn["MCBUSIMODE"] = " ".PadRight(3 ); 
         dwReturn["MCKUNDNRA"] = " ".PadRight(8 ); 
         dwReturn["MCKUNDADRE"] = " ".PadRight(8 ); 
         dwReturn["MCKUNDADRB"] = " ".PadRight(8 ); 
         dwReturn["MCKUNDNRR"] = " ".PadRight(8 ); 
         dwReturn["MCDRVERT"] = " ".PadRight(20 ); 
         dwReturn["MCCBOOKNO"] = " ".PadRight(15 ); 
         dwReturn["MCCITEMNO"] = " ".PadRight(0 ); 
         dwReturn["MCCVORDOC"] = " ".PadRight(10 ); 
         dwReturn["MCCGENEHM"] = " ".PadRight(22 ); 
         dwReturn["MCDOCT1"] = " ".PadRight(1 ); 
         dwReturn["MCDOCNB1"] = " ".PadRight(2 ); 
         dwReturn["MCDOCNO1"] = " ".PadRight(15 ); 
         dwReturn["MCDOCT2"] = " ".PadRight(1 ); 
         dwReturn["MCDOCNB2"] = " ".PadRight(2 ); 
         dwReturn["MCDOCNO2"] = " ".PadRight(15 ); 
         dwReturn["MCDOCT3"] = " ".PadRight(1 ); 
         dwReturn["MCDOCNB3"] = " ".PadRight(2 ); 
         dwReturn["MCDOCNO3"] = " ".PadRight(15 ); 
         dwReturn["MCDOCT4"] = " ".PadRight(1 ); 
         dwReturn["MCDOCNB4"] = " ".PadRight(2 ); 
         dwReturn["MCDOCNO4"] = " ".PadRight(15 ); 
         dwReturn["MCIVZWEIG"] = " ".PadRight(1 ); 
         dwReturn["MCFILLER"] = " ".PadRight(77 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapMCHAR(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveMCHAR(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryMCHAR(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapMCHAR(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertMCHAR(dwLocal, ITXDBVERSION);
            }
            UpdateMCHAR(dwLocal);
        }
        public void InsertMCHAR(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO MCHAR(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryMCHAR(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM MCHAR WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM MCHAR  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "MCHAR";
            Return = Result;
            return Return;
        }
        public void DeleteMCHAR(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM MCHAR   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateMCHAR(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE MCHAR SET "
                    +"MCMANDANT= :MCMANDANT,"
                    +"MCCHAR= :MCCHAR,"
                    +"MCMAT= :MCMAT,"
                    +"MCVAR= :MCVAR,"
                    +"MCEINDAT= :MCEINDAT,"
                    +"MCENTKZ= :MCENTKZ,"
                    +"MCEINLO= :MCEINLO,"
                    +"MCSPSTA= :MCSPSTA,"
                    +"MCSPGRD= :MCSPGRD,"
                    +"MCME= :MCME,"
                    +"MCEMEN= :MCEMEN,"
                    +"MCEGEB= :MCEGEB,"
                    +"MCGNRL= :MCGNRL,"
                    +"MCLIEFNR= :MCLIEFNR,"
                    +"MCLIEFSCH= :MCLIEFSCH,"
                    +"MCLIEFDAT= :MCLIEFDAT,"
                    +"MCKZZOLL= :MCKZZOLL,"
                    +"MCGEBANZ= :MCGEBANZ,"
                    +"MCVPEINH= :MCVPEINH,"
                    +"MCLMEH= :MCLMEH,"
                    +"MCLMEN= :MCLMEN,"
                    +"MCLMEB= :MCLMEB,"
                    +"MCAUFTYP= :MCAUFTYP,"
                    +"MCBESTKRS= :MCBESTKRS,"
                    +"MCBESTLFD= :MCBESTLFD,"
                    +"MCBESTPOS= :MCBESTPOS,"
                    +"MCABHS= :MCABHS,"
                    +"MCBUDGET= :MCBUDGET,"
                    +"MCRENR= :MCRENR,"
                    +"MCREDAT= :MCREDAT,"
                    +"MCREWERT= :MCREWERT,"
                    +"MCHALTT= :MCHALTT,"
                    +"MCHERDAT= :MCHERDAT,"
                    +"MCVERFDAT= :MCVERFDAT,"
                    +"MCAENDZL= :MCAENDZL,"
                    +"MCAENDBEN= :MCAENDBEN,"
                    +"MCAENDDAT= :MCAENDDAT,"
                    +"MCNEUBEN= :MCNEUBEN,"
                    +"MCNEUDAT= :MCNEUDAT,"
                    +"MCKZKONSI= :MCKZKONSI,"
                    +"MCTEILLFG= :MCTEILLFG,"
                    +"MCMAENGEL= :MCMAENGEL,"
                    +"MCZUDIRVB= :MCZUDIRVB,"
                    +"MCEINLB= :MCEINLB,"
                    +"MCSPEDF= :MCSPEDF,"
                    +"MCSPEDV= :MCSPEDV,"
                    +"MCSPEDZ= :MCSPEDZ,"
                    +"MCURRENR= :MCURRENR,"
                    +"MCARTGS= :MCARTGS,"
                    +"MCVERF= :MCVERF,"
                    +"MCAVVME= :MCAVVME,"
                    +"MCBEWPFL= :MCBEWPFL,"
                    +"MCBEFREI= :MCBEFREI,"
                    +"MCURLAND= :MCURLAND,"
                    +"MCIURLAND= :MCIURLAND,"
                    +"MCHALAND= :MCHALAND,"
                    +"MCVSLAND= :MCVSLAND,"
                    +"MCVZWEIG= :MCVZWEIG,"
                    +"MCTPMLKZ= :MCTPMLKZ,"
                    +"MCCONTV= :MCCONTV,"
                    +"MCCONTNR= :MCCONTNR,"
                    +"MCZOLLST= :MCZOLLST,"
                    +"MCZOLLSTAF= :MCZOLLSTAF,"
                    +"MCPRLAND= :MCPRLAND,"
                    +"MCURLANDWO= :MCURLANDWO,"
                    +"MCBUSIMODE= :MCBUSIMODE,"
                    +"MCKUNDNRA= :MCKUNDNRA,"
                    +"MCKUNDADRE= :MCKUNDADRE,"
                    +"MCKUNDADRB= :MCKUNDADRB,"
                    +"MCKUNDNRR= :MCKUNDNRR,"
                    +"MCDRVERT= :MCDRVERT,"
                    +"MCCBOOKNO= :MCCBOOKNO,"
                    +"MCCITEMNO= :MCCITEMNO,"
                    +"MCCVORDOC= :MCCVORDOC,"
                    +"MCCGENEHM= :MCCGENEHM,"
                    +"MCDOCT1= :MCDOCT1,"
                    +"MCDOCNB1= :MCDOCNB1,"
                    +"MCDOCNO1= :MCDOCNO1,"
                    +"MCDOCT2= :MCDOCT2,"
                    +"MCDOCNB2= :MCDOCNB2,"
                    +"MCDOCNO2= :MCDOCNO2,"
                    +"MCDOCT3= :MCDOCT3,"
                    +"MCDOCNB3= :MCDOCNB3,"
                    +"MCDOCNO3= :MCDOCNO3,"
                    +"MCDOCT4= :MCDOCT4,"
                    +"MCDOCNB4= :MCDOCNB4,"
                    +"MCDOCNO4= :MCDOCNO4,"
                    +"MCIVZWEIG= :MCIVZWEIG,"
                    +"MCFILLER= :MCFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("MCMANDANT", OracleType.NVarChar).Value = dwData["MCMANDANT"].ToString(); 
          or1.Parameters.Add("MCCHAR", OracleType.NVarChar).Value = dwData["MCCHAR"].ToString(); 
          or1.Parameters.Add("MCMAT", OracleType.NVarChar).Value = dwData["MCMAT"].ToString(); 
          or1.Parameters.Add("MCVAR", OracleType.NVarChar).Value = dwData["MCVAR"].ToString(); 
          or1.Parameters.Add("MCEINDAT", OracleType.NVarChar).Value = dwData["MCEINDAT"].ToString(); 
          or1.Parameters.Add("MCENTKZ", OracleType.NVarChar).Value = dwData["MCENTKZ"].ToString(); 
          or1.Parameters.Add("MCEINLO", OracleType.NVarChar).Value = dwData["MCEINLO"].ToString(); 
          or1.Parameters.Add("MCSPSTA", OracleType.NVarChar).Value = dwData["MCSPSTA"].ToString(); 
          or1.Parameters.Add("MCSPGRD", OracleType.NVarChar).Value = dwData["MCSPGRD"].ToString(); 
          or1.Parameters.Add("MCME", OracleType.NVarChar).Value = dwData["MCME"].ToString(); 
          or1.Parameters.Add("MCEMEN", OracleType.NVarChar).Value = dwData["MCEMEN"].ToString(); 
          or1.Parameters.Add("MCEGEB", OracleType.NVarChar).Value = dwData["MCEGEB"].ToString(); 
          or1.Parameters.Add("MCGNRL", OracleType.NVarChar).Value = dwData["MCGNRL"].ToString(); 
          or1.Parameters.Add("MCLIEFNR", OracleType.NVarChar).Value = dwData["MCLIEFNR"].ToString(); 
          or1.Parameters.Add("MCLIEFSCH", OracleType.NVarChar).Value = dwData["MCLIEFSCH"].ToString(); 
          or1.Parameters.Add("MCLIEFDAT", OracleType.NVarChar).Value = dwData["MCLIEFDAT"].ToString(); 
          or1.Parameters.Add("MCKZZOLL", OracleType.NVarChar).Value = dwData["MCKZZOLL"].ToString(); 
          or1.Parameters.Add("MCGEBANZ", OracleType.NVarChar).Value = dwData["MCGEBANZ"].ToString(); 
          or1.Parameters.Add("MCVPEINH", OracleType.NVarChar).Value = dwData["MCVPEINH"].ToString(); 
          or1.Parameters.Add("MCLMEH", OracleType.NVarChar).Value = dwData["MCLMEH"].ToString(); 
          or1.Parameters.Add("MCLMEN", OracleType.NVarChar).Value = dwData["MCLMEN"].ToString(); 
          or1.Parameters.Add("MCLMEB", OracleType.NVarChar).Value = dwData["MCLMEB"].ToString(); 
          or1.Parameters.Add("MCAUFTYP", OracleType.NVarChar).Value = dwData["MCAUFTYP"].ToString(); 
          or1.Parameters.Add("MCBESTKRS", OracleType.NVarChar).Value = dwData["MCBESTKRS"].ToString(); 
          or1.Parameters.Add("MCBESTLFD", OracleType.NVarChar).Value = dwData["MCBESTLFD"].ToString(); 
          or1.Parameters.Add("MCBESTPOS", OracleType.NVarChar).Value = dwData["MCBESTPOS"].ToString(); 
          or1.Parameters.Add("MCABHS", OracleType.NVarChar).Value = dwData["MCABHS"].ToString(); 
          or1.Parameters.Add("MCBUDGET", OracleType.NVarChar).Value = dwData["MCBUDGET"].ToString(); 
          or1.Parameters.Add("MCRENR", OracleType.NVarChar).Value = dwData["MCRENR"].ToString(); 
          or1.Parameters.Add("MCREDAT", OracleType.NVarChar).Value = dwData["MCREDAT"].ToString(); 
          or1.Parameters.Add("MCREWERT", OracleType.NVarChar).Value = dwData["MCREWERT"].ToString(); 
          or1.Parameters.Add("MCHALTT", OracleType.NVarChar).Value = dwData["MCHALTT"].ToString(); 
          or1.Parameters.Add("MCHERDAT", OracleType.NVarChar).Value = dwData["MCHERDAT"].ToString(); 
          or1.Parameters.Add("MCVERFDAT", OracleType.NVarChar).Value = dwData["MCVERFDAT"].ToString(); 
          or1.Parameters.Add("MCAENDZL", OracleType.NVarChar).Value = dwData["MCAENDZL"].ToString(); 
          or1.Parameters.Add("MCAENDBEN", OracleType.NVarChar).Value = dwData["MCAENDBEN"].ToString(); 
          or1.Parameters.Add("MCAENDDAT", OracleType.NVarChar).Value = dwData["MCAENDDAT"].ToString(); 
          or1.Parameters.Add("MCNEUBEN", OracleType.NVarChar).Value = dwData["MCNEUBEN"].ToString(); 
          or1.Parameters.Add("MCNEUDAT", OracleType.NVarChar).Value = dwData["MCNEUDAT"].ToString(); 
          or1.Parameters.Add("MCKZKONSI", OracleType.NVarChar).Value = dwData["MCKZKONSI"].ToString(); 
          or1.Parameters.Add("MCTEILLFG", OracleType.NVarChar).Value = dwData["MCTEILLFG"].ToString(); 
          or1.Parameters.Add("MCMAENGEL", OracleType.NVarChar).Value = dwData["MCMAENGEL"].ToString(); 
          or1.Parameters.Add("MCZUDIRVB", OracleType.NVarChar).Value = dwData["MCZUDIRVB"].ToString(); 
          or1.Parameters.Add("MCEINLB", OracleType.NVarChar).Value = dwData["MCEINLB"].ToString(); 
          or1.Parameters.Add("MCSPEDF", OracleType.NVarChar).Value = dwData["MCSPEDF"].ToString(); 
          or1.Parameters.Add("MCSPEDV", OracleType.NVarChar).Value = dwData["MCSPEDV"].ToString(); 
          or1.Parameters.Add("MCSPEDZ", OracleType.NVarChar).Value = dwData["MCSPEDZ"].ToString(); 
          or1.Parameters.Add("MCURRENR", OracleType.NVarChar).Value = dwData["MCURRENR"].ToString(); 
          or1.Parameters.Add("MCARTGS", OracleType.NVarChar).Value = dwData["MCARTGS"].ToString(); 
          or1.Parameters.Add("MCVERF", OracleType.NVarChar).Value = dwData["MCVERF"].ToString(); 
          or1.Parameters.Add("MCAVVME", OracleType.NVarChar).Value = dwData["MCAVVME"].ToString(); 
          or1.Parameters.Add("MCBEWPFL", OracleType.NVarChar).Value = dwData["MCBEWPFL"].ToString(); 
          or1.Parameters.Add("MCBEFREI", OracleType.NVarChar).Value = dwData["MCBEFREI"].ToString(); 
          or1.Parameters.Add("MCURLAND", OracleType.NVarChar).Value = dwData["MCURLAND"].ToString(); 
          or1.Parameters.Add("MCIURLAND", OracleType.NVarChar).Value = dwData["MCIURLAND"].ToString(); 
          or1.Parameters.Add("MCHALAND", OracleType.NVarChar).Value = dwData["MCHALAND"].ToString(); 
          or1.Parameters.Add("MCVSLAND", OracleType.NVarChar).Value = dwData["MCVSLAND"].ToString(); 
          or1.Parameters.Add("MCVZWEIG", OracleType.NVarChar).Value = dwData["MCVZWEIG"].ToString(); 
          or1.Parameters.Add("MCTPMLKZ", OracleType.NVarChar).Value = dwData["MCTPMLKZ"].ToString(); 
          or1.Parameters.Add("MCCONTV", OracleType.NVarChar).Value = dwData["MCCONTV"].ToString(); 
          or1.Parameters.Add("MCCONTNR", OracleType.NVarChar).Value = dwData["MCCONTNR"].ToString(); 
          or1.Parameters.Add("MCZOLLST", OracleType.NVarChar).Value = dwData["MCZOLLST"].ToString(); 
          or1.Parameters.Add("MCZOLLSTAF", OracleType.NVarChar).Value = dwData["MCZOLLSTAF"].ToString(); 
          or1.Parameters.Add("MCPRLAND", OracleType.NVarChar).Value = dwData["MCPRLAND"].ToString(); 
          or1.Parameters.Add("MCURLANDWO", OracleType.NVarChar).Value = dwData["MCURLANDWO"].ToString(); 
          or1.Parameters.Add("MCBUSIMODE", OracleType.NVarChar).Value = dwData["MCBUSIMODE"].ToString(); 
          or1.Parameters.Add("MCKUNDNRA", OracleType.NVarChar).Value = dwData["MCKUNDNRA"].ToString(); 
          or1.Parameters.Add("MCKUNDADRE", OracleType.NVarChar).Value = dwData["MCKUNDADRE"].ToString(); 
          or1.Parameters.Add("MCKUNDADRB", OracleType.NVarChar).Value = dwData["MCKUNDADRB"].ToString(); 
          or1.Parameters.Add("MCKUNDNRR", OracleType.NVarChar).Value = dwData["MCKUNDNRR"].ToString(); 
          or1.Parameters.Add("MCDRVERT", OracleType.NVarChar).Value = dwData["MCDRVERT"].ToString(); 
          or1.Parameters.Add("MCCBOOKNO", OracleType.NVarChar).Value = dwData["MCCBOOKNO"].ToString(); 
          or1.Parameters.Add("MCCITEMNO", OracleType.NVarChar).Value = dwData["MCCITEMNO"].ToString(); 
          or1.Parameters.Add("MCCVORDOC", OracleType.NVarChar).Value = dwData["MCCVORDOC"].ToString(); 
          or1.Parameters.Add("MCCGENEHM", OracleType.NVarChar).Value = dwData["MCCGENEHM"].ToString(); 
          or1.Parameters.Add("MCDOCT1", OracleType.NVarChar).Value = dwData["MCDOCT1"].ToString(); 
          or1.Parameters.Add("MCDOCNB1", OracleType.NVarChar).Value = dwData["MCDOCNB1"].ToString(); 
          or1.Parameters.Add("MCDOCNO1", OracleType.NVarChar).Value = dwData["MCDOCNO1"].ToString(); 
          or1.Parameters.Add("MCDOCT2", OracleType.NVarChar).Value = dwData["MCDOCT2"].ToString(); 
          or1.Parameters.Add("MCDOCNB2", OracleType.NVarChar).Value = dwData["MCDOCNB2"].ToString(); 
          or1.Parameters.Add("MCDOCNO2", OracleType.NVarChar).Value = dwData["MCDOCNO2"].ToString(); 
          or1.Parameters.Add("MCDOCT3", OracleType.NVarChar).Value = dwData["MCDOCT3"].ToString(); 
          or1.Parameters.Add("MCDOCNB3", OracleType.NVarChar).Value = dwData["MCDOCNB3"].ToString(); 
          or1.Parameters.Add("MCDOCNO3", OracleType.NVarChar).Value = dwData["MCDOCNO3"].ToString(); 
          or1.Parameters.Add("MCDOCT4", OracleType.NVarChar).Value = dwData["MCDOCT4"].ToString(); 
          or1.Parameters.Add("MCDOCNB4", OracleType.NVarChar).Value = dwData["MCDOCNB4"].ToString(); 
          or1.Parameters.Add("MCDOCNO4", OracleType.NVarChar).Value = dwData["MCDOCNO4"].ToString(); 
          or1.Parameters.Add("MCIVZWEIG", OracleType.NVarChar).Value = dwData["MCIVZWEIG"].ToString(); 
          or1.Parameters.Add("MCFILLER", OracleType.NVarChar).Value = dwData["MCFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
